package com.world.rickcloudendpoint.demo;

import com.world.rickcloudendpoint.demo.model.DemoMessage;
import com.world.rickcloudendpoint.demo.model.DemoPosition;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @description: 公共提取方法
 * @author: jlsong
 * @date: 2022/06/04 04:01:28
 * @version: 1.0
 */
public class CommonMethod {
    public static List<DemoPosition> getPositions(List<DemoMessage> sortRecords) {
        return sortRecords.stream().map(s -> {
            DemoPosition p = new DemoPosition();
            p.setLon(s.getLon());
            p.setLat(s.getLat());
            p.setAlt(s.getAlt());
            return p;
        }).collect(Collectors.toList());
    }

}
